import request from '@/config/axios'

export interface EvalCandidateInfoVO {
  id?: number
  planId: number
  candidateId?: number
  name: string
  idNumber: string
  mobile?: string
  email?: string
  gender?: number
  birthDate?: string
  workUnit?: string
  department?: string
  position?: string
  workYears?: number
  appliedLevel: string
  appliedProfession?: string
  dataSource?: number
  importBatchId?: string
  registrationStatus?: number
  registrationTime?: string
  confirmationTime?: string
  remarks?: string
  createTime?: string
  updateTime?: string
}

export interface EvalCandidateInfoPageReqVO {
  planId?: number
  name?: string
  idNumber?: string
  mobile?: string
  appliedLevel?: string
  registrationStatus?: number
  createTime?: string[]
}

// 查询参评人员信息分页
export const getCandidateInfoPage = (params: EvalCandidateInfoPageReqVO) => {
  return request.get({ url: '/eval/candidate-info/page', params })
}

// 查询参评人员信息详情
export const getCandidateInfo = (id: number) => {
  return request.get({ url: '/eval/candidate-info/get?id=' + id })
}

// 新增参评人员信息
export const createCandidateInfo = (data: EvalCandidateInfoVO) => {
  return request.post({ url: '/eval/candidate-info/create', data })
}

// 修改参评人员信息
export const updateCandidateInfo = (data: EvalCandidateInfoVO) => {
  return request.put({ url: '/eval/candidate-info/update', data })
}

// 删除参评人员信息
export const deleteCandidateInfo = (id: number) => {
  return request.delete({ url: '/eval/candidate-info/delete?id=' + id })
}

// 导出参评人员信息 Excel
export const exportCandidateInfo = (params: EvalCandidateInfoPageReqVO) => {
  return request.download({ url: '/eval/candidate-info/export-excel', params })
}
